<!DOCTYPE html>
<html>
<head>
	<div th:include="base-libs-easyui :: base-libs-easyui" />
		<script th:src="@{/plat/js/md5.js}"></script>
	<title>分级诊疗平台登录</title>

	<style>
	body {
		padding: 0px 10px;
	}
	 input{
		 width: 170px;
	 }
	</style>
	<script th:inline="javascript">
        var domainKey = [[${domainKey}]];
	</script>
	<script>
		$(function() {
			initView();
		})

		function initView() {
			$.removeCookie(domainKey, {path: "/"});
		}

		function btnLoginHandler()
		{
			if($(".form-control").QuickValidate())
			{
				$("#hexPwd").val(hex_md5($("#pwd").val()));
				$("#formLogin").submit();
			}
		}

		function login(){
			$.QuickRemote.AjaxFiledFormSubmit("formLogin", function(result){
				if(result["state"]){
					$.cookie(result["domainKey"], result["domainId"], {path: "/"});
					location = "/plat/index.html";
				}
			});
		}
	</script>
</head>

<body>
	<h4 class="nomargin">登录</h4>
	<div style="margin: 50px auto;">
		<form id="formLogin" method="post" action="login.service">
			<table>
				<tr>
					<td>
						<span>用户名</span>
					</td>
					<td>
						<input type="text" placeholder="用户名" name="USERNAME"
							   class="form-control" quick-config="label:'用户名', validateProxy:'notNull length', length: '20'" />
					</td>
				</tr>
				<tr>
					<td><span>密码</span></td>
					<td>
						<input id="pwd" type="password" placeholder="密码"
							   class="form-control pword" quick-config="label:'密码', validateProxy:'notNull length', length: '20'" />
						<input id="hexPwd" name="PASSWORD" style="display: none;">
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<a href=""><small>忘记密码?</small></a>&nbsp;
						<button class="btn btn-success" type="button" onclick="btnLoginHandler()">登录</button>
					</td>
				</tr>
			</table>
		</form>
	</div>
</body>
</html>
